package com.sihai.ehr.service;

import java.util.List;

import com.sihai.core.Limit;
import com.sihai.core.LimitedList;
import com.sihai.core.Sorter;
import com.sihai.ehr.model.biz.ExamPeriod;
import com.sihai.ehr.model.biz.ExamStatistics;
import com.sihai.ehr.model.sys.ExaminePeriodEnum;
import com.sihai.ehr.web.pojo.ExamStatisticsPojo;

/**
 * 员工考核统计信息服务接口
 * 
 * @author henry
 * 
 */
public interface ExamStatisticsService {

	ExamStatistics getExamStatistics(Long id);

	/** 获取定性考核员工分数 */
	ExamStatistics getExamStatistics(Long periodId, Long workId);

	/** 获取定性考核员工上一期分数 */
	Float getExamPrevScore(ExaminePeriodEnum periodEnum, Long workId,
			Long periodId);

	/**
	 * 根据周期编号查询考核打分统计列表
	 * 
	 * @param periodId
	 * @param limit
	 * @param sorter
	 * @return
	 */
	LimitedList<ExamStatistics> searchExamStatisticsByPeriod(Long periodId,
			Limit limit, Sorter sorter);

	/**
	 * 根据员工任职信息查询员工统计打分列表
	 * 
	 * @param workId
	 * @param limit
	 * @param sorter
	 * @return
	 */
	LimitedList<ExamStatistics> searchExamStatisticsByWork(Long workId,
			Limit limit, Sorter sorter);

	/**
	 * 搜索员工考核统计分析数据
	 * @param examType 考核类型：0所有，1定性，2定量
	 * @param organizationId
	 * @param dutyId
	 * @param periodEnum
	 * @param limit
	 * @param sorter
	 * @return
	 */
	LimitedList<ExamStatisticsPojo> searchExamStatisticsPojos(int examType, Long organizationId, Long dutyId, ExaminePeriodEnum periodEnum, List<ExamPeriod> examPeriods,Limit limit,
			Sorter sorter);

    //搜索具体某个员工考核统计分析数据
    public LimitedList<ExamStatisticsPojo> searchExamStatisticsPojoForUser(int examType, final Long workId, final ExaminePeriodEnum periodEnum, final List<ExamPeriod> examPeriods);

	/**
	 * 保存员工考核统计信息
	 * 
	 * @param examStatistics
	 */
	void saveExamStatistics(ExamStatistics examStatistics);

	/**
	 * 删除员工考核统计信息
	 * 
	 * @param periodId
	 * @param workId
	 */
	void deleteExamStatistics(Long periodId, Long workId);

    /**
     * 查找指定员工指定周期类型的全年分数
     * @param workId
     * @param periodEnum
     * @return
     */
    List<Object[]> findScoresByYear(Long workId, ExaminePeriodEnum periodEnum, int year);
}
